<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>整车审核管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			var dataBoard = ${fns:toJson(tRentgroupAudit.rentgroup.productList)};
			var productTpl = 'productTpl';	
			for (var i=0; i<dataBoard.length; i++){
				addRow('#productList', i, productTpl, dataBoard[i] );
			}
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		function addRow(list, idx, tpl, row){
			var data = {idx: idx, delBtn: true, row:row};
			var html = template(tpl, data); // 渲染模板
	
			$(list).append(html);
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/rentproduct/tRentgroup/rentforaudit">包车待审核列表</a></li>
		<li class="active"><a href="${ctx}/rentproduct/tRentgroupAudit/form?rentgroup.rentgrpid=${tRentgroupAudit.rentgroup.rentgrpid}">整车审核意见</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="tRentgroupAudit" action="${ctx}/rentproduct/tRentgroupAudit/save" method="post" class="form-horizontal">
 		<c:if test="${tRentgroupAudit.rentgroup.renttype == '4'}">
 		<div class="control-group">
			<label class="control-label">产品名称：</label>
			<div class="controls">
				<form:input path="rentgroup.productname" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div> 
		<div class="control-group">
			<label class="control-label">出发地：</label>
			<div class="controls">
				<form:input path="rentgroup.departcity.sitename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">套餐标准时长：</label>
			<div class="controls">
				<form:input path="rentgroup.lasthour" htmlEscape="false" maxlength="100" readonly="true" class="digits span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">套餐标准公里数：</label>
			<div class="controls">
				<form:input path="rentgroup.kms" htmlEscape="false" maxlength="100" readonly="true" class="digits span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车型报价：</label>
			<div class="controls">
				<table id="contentTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<th>车型</th>
							<th>套餐价(天)</th>
							<th>可乘人数</th>
							<th>行李数</th>
							<th>超时长费</th>
							<th>超公里数</th>
							<th>空驶费</th>
							<th width="10">&nbsp;</th>
						</tr>
					</thead>
					<tbody id="productList">
					</tbody>
						<tfoot>
						</tfoot>
				</table>
				<script type="text/template" id="productTpl">
						<tr id="productList{{idx}}">
							<td class="hide">
							</td>
							<td>
								<input id="productList{{idx}}_cargotype" name="productList[{{idx}}].cargotype.typename" 
								value="{{row.cargotype.typename}}" type="text" readonly class="input-medium"/>  
							</td>
							<td>
								<input id="productList{{idx}}_suitrtnprice"
								name="productList[{{idx}}].suitrtnprice" type="text" readonly class="span2 money" 
								{{if row}}value="{{row.suitrtnprice}}"{{/if}}  />
							</td>
						    <td>					
								<input id="productList{{idx}}_seats" name="productList[{{idx}}].seats" 
								type="text" class="input-small" readonly 
								{{if row}}value="{{row.seats}}"{{/if}} />
							</td>
						    <td>					
								<input id="productList{{idx}}_packs" name="productList[{{idx}}].packs" 
								type="text" class="input-small"  readonly 
								{{if row}}value="{{row.packs}}"{{/if}} />
							</td>
						    <td>
								<input id="productList{{idx}}_outtimefee"
								name="productList[{{idx}}].outtimefee" type="text"  readonly class="span1  money"
								{{if row}}value="{{row.outtimefee}}"{{/if}}  />
							</td>
						    <td>
								<input id="productList{{idx}}_outkmsfee"
								name="productList[{{idx}}].outkmsfee" type="text" readonly class="span1  money"
								{{if row}}value="{{row.outkmsfee}}"{{/if}}  />
							</td>
						    <td>
								<input id="productList{{idx}}_nonoccu"
								name="productList[{{idx}}].nonoccu" type="text" readonly class="span1  money"
								{{if row}}value="{{row.nonoccu}}"{{/if}}  />
							</td>
							<td class="text-center" width="10">
							</td>
						</tr>
					</script>
				<script type="text/javascript">

					</script>
			</div>
		</div>
		</c:if>
		<c:if test="${tRentgroupAudit.rentgroup.renttype == '1'}">
 		<div class="control-group">
			<label class="control-label">产品名称：</label>
			<div class="controls">
				<form:input path="rentgroup.productname" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div> 
		<div class="control-group">
			<label class="control-label">线路名称：</label>
			<div class="controls">
			<form:input path="rentgroup.tLine.linename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
				<span class="help-inline"><font color="red">*</font></span>
			</div>
		</div>
		<div class="control-group" id="trtype">
			<label class="control-label">旅游包车类型：</label>
			<div class="controls">			
				<input type="radio" value="1" name="traveltype" disabled ${tRentgroupAudit.rentgroup.traveltype==1?'checked':'' }>周边游
				<input type="radio" value="2" name="traveltype" disabled ${tRentgroupAudit.rentgroup.traveltype==2?'checked':'' }>目的地游
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">出发地：</label>
			<div class="controls">
				<form:input path="rentgroup.departcity.sitename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">目的地：</label>
			<div class="controls">
				<form:input path="rentgroup.destcity.sitename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">经停城市：</label>
			<div class="controls">
				<form:input path="rentgroup.tLine.stopsites" htmlEscape="false"  readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">天数：</label>
			<div class="controls">
				<form:input path="rentgroup.tLine.estdays" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">线路描述：</label>
			<div class="controls">
				<form:textarea path="rentgroup.tLine.description" htmlEscape="false" maxlength="275" readonly="true" class="span4"/>		
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车型报价：</label>
			<div class="controls">
				<table id="contentTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<th>车型</th>
							<th>一口价</th>
							<th>可乘人数</th>
							<th id="types2">行李数</th>
							<th id="types3">超时长费（元/小时）</th>
							<th width="10">&nbsp;</th>
						</tr>
					</thead>
					<tbody id="productList">
					</tbody>
						<tfoot>
							<tr>
								<td colspan="5"></td>
							</tr>
						</tfoot>
				</table>
				<script type="text/template" id="productTpl">
						<tr id="productList{{idx}}">
							<td>
								<input id="productList{{idx}}_cargotype" name="productList[{{idx}}].cargotype.typename" 
								value="{{row.cargotype.typename}}" type="text" readonly class="input-medium"/>  
							</td>
							<td>
								<input id="productList{{idx}}_suitrtnprice"
								name="productList[{{idx}}].suitrtnprice" type="text" readonly class="span2" 
								{{if row}}value="{{row.suitrtnprice}}"{{/if}}  />
							</td>
						    <td>					
								<input id="productList{{idx}}_seats" name="productList[{{idx}}].seats" 
								type="text" class="span2" readonly 
								{{if row}}value="{{row.seats}}"{{/if}} />
							</td>
						    <td>					
								<input id="productList{{idx}}_packs" name="productList[{{idx}}].packs" 
								type="text" class="span2"  readonly 
								{{if row}}value="{{row.packs}}"{{/if}} />
							</td>
						    <td>
								<input id="productList{{idx}}_outtimefee"
								name="productList[{{idx}}].outtimefee" type="text" readonly class="span2"
								{{if row}}value="{{row.outtimefee}}"{{/if}}  />
							</td>
							<td class="text-center" width="10">
								
							</td>
						</tr>
					</script>
				<script type="text/javascript">

					</script>
			</div>
		</div>
		</c:if>
		<c:if test="${tRentgroupAudit.rentgroup.renttype == '2'}">
 		<div class="control-group">
			<label class="control-label">产品名称：</label>
			<div class="controls">
				<form:input path="rentgroup.productname" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div> 
		<div class="control-group">
			<label class="control-label">线路名称：</label>
			<div class="controls">
			<form:input path="rentgroup.tLine.linename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
				<span class="help-inline"><font color="red">*</font></span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">出发地：</label>
			<div class="controls">
				<form:input path="rentgroup.departcity.sitename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">目的地：</label>
			<div class="controls">
				<form:input path="rentgroup.destcity.sitename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车型报价：</label>
			<div class="controls">
				<table id="contentTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<th>车型</th>
							<th>一口价</th>
							<th>可乘人数</th>
							<th id="types2">行李数</th>
							<th width="10">&nbsp;</th>
						</tr>
					</thead>
					<tbody id="productList">
					</tbody>
						<tfoot>
							<tr>
								<td colspan="5"></td>
							</tr>
						</tfoot>
				</table>
				<script type="text/template" id="productTpl">
						<tr id="productList{{idx}}">
							<td>
								<input id="productList{{idx}}_cargotype" name="productList[{{idx}}].cargotype.typename" 
								value="{{row.cargotype.typename}}" type="text" readonly class="input-medium"/>  
							</td>
							<td>
								<input id="productList{{idx}}_suitrtnprice"
								name="productList[{{idx}}].suitrtnprice" type="text" readonly class="span2" 
								{{if row}}value="{{row.suitrtnprice}}"{{/if}}  />
							</td>
						    <td>					
								<input id="productList{{idx}}_seats" name="productList[{{idx}}].seats" 
								type="text" class="span2" readonly 
								{{if row}}value="{{row.seats}}"{{/if}} />
							</td>
						    <td>					
								<input id="productList{{idx}}_packs" name="productList[{{idx}}].packs" 
								type="text" class="span2"  readonly 
								{{if row}}value="{{row.packs}}"{{/if}} />
							</td>
							<td class="text-center" width="10">
								
							</td>
						</tr>
					</script>
				<script type="text/javascript">

					</script>
			</div>
		</div>
		</c:if>
		<c:if test="${tRentgroupAudit.rentgroup.renttype == '3'}">
 		<div class="control-group">
			<label class="control-label">产品名称：</label>
			<div class="controls">
				<form:input path="rentgroup.productname" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div> 
		<div class="control-group">
			<label class="control-label">线路名称：</label>
			<div class="controls">
			<form:input path="rentgroup.tLine.linename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
				<span class="help-inline"><font color="red">*</font></span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">出发地：</label>
			<div class="controls">
				<form:input path="rentgroup.departcity.sitename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">目的地：</label>
			<div class="controls">
				<form:input path="rentgroup.destcity.sitename" htmlEscape="false" maxlength="50" readonly="true" class="span4"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车型报价：</label>
			<div class="controls">
				<table id="contentTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<th>车型</th>
							<th>一口价</th>
							<th>可乘人数</th>
							<th id="types2">行李数</th>
							<th width="10">&nbsp;</th>
						</tr>
					</thead>
					<tbody id="productList">
					</tbody>
						<tfoot>
							<tr>
								<td colspan="5"></td>
							</tr>
						</tfoot>
				</table>
				<script type="text/template" id="productTpl">
						<tr id="productList{{idx}}">
							<td>
								<input id="productList{{idx}}_cargotype" name="productList[{{idx}}].cargotype.typename" 
								value="{{row.cargotype.typename}}" type="text" readonly class="input-medium"/>  
							</td>
							<td>
								<input id="productList{{idx}}_suitrtnprice"
								name="productList[{{idx}}].suitrtnprice" type="text" readonly class="span2" 
								{{if row}}value="{{row.suitrtnprice}}"{{/if}}  />
							</td>
						    <td>					
								<input id="productList{{idx}}_seats" name="productList[{{idx}}].seats" 
								type="text" class="span2" readonly 
								{{if row}}value="{{row.seats}}"{{/if}} />
							</td>
						    <td>					
								<input id="productList{{idx}}_packs" name="productList[{{idx}}].packs" 
								type="text" class="span2"  readonly 
								{{if row}}value="{{row.packs}}"{{/if}} />
							</td>
							<td class="text-center" width="10">
								
							</td>
						</tr>
					</script>
				<script type="text/javascript">

					</script>
			</div>
		</div>
		</c:if>
		<form:hidden path="rentauditid"/>
		<form:hidden path="rentgroup.rentgrpid"/>
		<sys:message content="${message}"/>	
		<div class="control-group">
			<label class="control-label">审核结果：</label>
			<div class="controls">
				<input type="radio" name="auditopn" value="1" class="required" ${tRentgroupAudit.auditopn == '1'?'checked':'' }/>通过
				<input type="radio" name="auditopn" value="2" class="required" ${tRentgroupAudit.auditopn == '2'?'checked':'' }/>不通过
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">具体意见：</label>
			<div class="controls">
				<form:textarea path="opndetail" rows="5" cols="3" htmlEscape="false" maxlength="200" class="input-xlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>